#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
const int N = 100;

int nums[N];

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T;
    cin >> T;
    int n;
    while(T--){
        cin >> n;
        for(int i = 1; i <= n; i ++) cin >> nums[i];
        int res_color = 1, res_cnt = nums[1];
        for(int i = 2; i <= n; i ++){
            if(res_cnt > nums[i]){
                res_cnt -= nums[i];
            }else if(res_cnt == nums[i]){
                res_color = i + 1;
                res_cnt = nums[i + 1];
                i ++;
            }else{ // res < nums[i]
                 res_cnt = nums[i] - res_cnt;
                 res_color = i;
            }
        }

        cout << res_color << '\n';

    }


    return 0;
}